{include file="public_head" /}
<!-- upload -->
<link href="__STATIC__/css/uploads.css" rel="stylesheet">
<!-- upload_arr -->
<link href="__STATIC__/plupload/plupload.css" rel="stylesheet">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<!-- sku -->
<link href="__STATIC__/css/sku.css" rel="stylesheet" type="text/css">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<link rel="stylesheet" href="/pic/js/amazeui.min.css" />
<style>
    .middle-img {
        position: absolute;
        left: 259px;
        top: 0px;
        width: 40px;
    }

    .up-img {
        position: absolute;
        top: -40px;
        left: 261px;
        width: 40px;
    }

    .down-img {
        position: absolute;
        top: 40px;
        left: 257px;
        width: 40px;
    }

    .left-img {
        position: absolute;
        left: 218px;
        width: 40px;
    }

    .right-img {
        position: absolute;
        left: 300px;
        width: 40px;
    }
    @media screen and (max-width:450px) {
        .middle-img {
            position: absolute;
            left: 259px;
            top: 0px;
            width: 40px;
            display: none;
        }

        .up-img {
            position: absolute;
            top: -40px;
            left: 261px;
            width: 40px;
            display: none;
        }

        .down-img {
            position: absolute;
            top: 40px;
            left: 257px;
            width: 40px;
            display: none;
        }

        .left-img {
            position: absolute;
            left: 218px;
            width: 40px;
            display: none;
        }

        .right-img {
            position: absolute;
            left: 300px;
            width: 40px;
            display: none;
        }

        .rotate_jia{
            display: none;
        }.rotate_div{
             display: none;
         }.rotate_jian{
              display: none;
          }
    }
</style>

<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>服务订单管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>查看订单
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>

                            <div class="x_content" id="ele2"><div id="printArea">
                                <style>
                                    .form-group{margin-bottom:0}
                                    .form-horizontal .control-labe {padding-top: 0}
                                </style>
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                      method="post" id="registerForm">
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">所属分类：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.cat_name}->{$item.one_cat}</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">订 单 号：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.order_number}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">用户账号：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.username}</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车牌号：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">

                                            <input type="text" style="float: left; height: 34px; margin-right: 10px;" name="car_number" value="{$item.o_car_number}"
                                                   {if condition="session('role_id') neq 1"}
                                                   {if condition="strpos($item.o_car_number,'-') === false && $item.o_car_number neq ''"}
                                                   readonly
                                                   {/if}
                                            {/if}
                                            />
                                            {empty name="$item.car_number"}<a  class="btn btn-primary" onClick="car_number(this)">修改</a>{/empty}
                                            {if condition="session('role_id') eq 1"}
                                            {notempty name="$item.o_car_number"}<a  class="btn btn-primary" onClick="car_number2(this)">确认车牌</a>{/notempty}
                                            {else/}
                                            {if condition="strpos($item.o_car_number,'-') !== false"}<a  class="btn btn-primary" onClick="car_number2(this)">确认车牌</a>{/if}
                                            {/if}

                                        </div>
                                    </div>
                                    <script>
                                        function car_number(t) {
                                            var member_id = "{$item.member_id}";
                                            var order_id = "{:input('id')}";
                                            var v = $(t).prev().val();
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('member/car_number')}",
                                                data: {id:member_id,car_number:v,order_id:order_id},
                                                dataType: "json",
                                                success: function(ret){
                                                    //ret == true == 1/*?*/
                                                    if(ret == true){
                                                        layer.msg(ret.message);
                                                        history.go(0);
                                                    }
                                                    else{
                                                        layer.msg(ret.message);
                                                        history.go(0);
                                                    }
                                                }

                                            });
                                        }


                                        function car_number2(t) {
                                            var member_id = "{$item.member_id}";
                                            //alert(member_id);
                                            var v = $(t).prev().val();
                                           // alert(v);
                                            var order_id = "{:input('id')}";
                                           // alert(order_id);
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('member/car_number2')}",
                                                data: {id:member_id,car_number:v,order_id:order_id},
                                                dataType: "json",
                                                success: function(ret){
                                                    //ret == true == 1/*?*/
                                                    if(ret == true){
                                                        layer.msg(ret.message);
                                                        history.go(0);
                                                    }
                                                    else{
                                                        layer.msg(ret.message);
                                                        history.go(0);
                                                    }
                                                }

                                            });
                                        }
                                    </script>

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">是否认证：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{:input('is_certification_text')}</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">绩效订单：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>
                                                {switch name="item.finance_order"}
                                                {case 1}业务员订单{/case}
                                                {case 2}二维码订单{/case}
                                                {case 3}门店订单{/case}
                                                {case 4}普通订单{/case}
                                                {default /}-
                                                {/switch}
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">(线上/下)订单：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>
                                                {switch name="item.order_online"}
                                                {case 1}线上订单{/case}
                                                {case 2}线下订单{/case}
                                                {default /}-
                                                {/switch}
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">支付类型：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>
                                                {switch name="item.pay_type"}
                                                {case 1}微信{/case}
                                                {case 2}支付宝{/case}
                                                {default /}-
                                                {/switch}
                                            </div>
                                        </div>
                                    </div>
                                    <!--<div class="form-group tc">-->
                                        <!--<label class="control-label col-md-3 ">优惠券使用情况：</label>-->
                                        <!--<div class="col-md-6 " style="margin-top: 10px;">-->
                                            <!--<div>-->
                                                <!--标题 : {$item.coupon_title}-满 : {$item.coupon_totol_price} 元 - {$item.coupon_price} 元-->
                                            <!--</div>-->
                                        <!--</div>-->
                                    <!--</div>-->



                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">下单/退款 时间：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.create_time}{in name="$item.status" value="10,11,12"} / {$item.refund_create_time}{/in}</div>
                                        </div>
                                    </div>

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">服务门店：</label>
                                        <div class="col-md-2 ">
                                            {if condition="$auding_status eq 2"}
                                            <select name="shop_id" class="form-control select2_single" style="width: 300px;float: left;" tabindex="-1" {in name="$item.status" value="4,5"}disabled{/in}>
                                            <option value="0">请选择门店</option>
                                            {foreach :model('shop')->where('auding_status',2)->order('shop_status','asc')->select() as $key=>$vo }
                                            <option value="{$vo.id}" {eq name='$item.shop_id|default=""' value='$vo.id' }selected{/eq}>{switch name="$vo.shop_status"}
                                            {case 1}空闲{/case}
                                            {case 2}{$vo.wait_time_index}-{$vo.wait_time_h}时{$vo.wait_time_m}分{/case}
                                            {/switch}-{$vo.shop_title}</option>
                                            {/foreach}
                                            </select>
                                            {else/}
                                            {:model('shop')->where('id',$item.shop_id)->value('shop_title')}
                                            <input name="shop_id" type="hidden" value="{$item.shop_id}">
                                            {/if}
                                        </div>
                                    </div>

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">{eq name="$item.single_id" value="11"}寄存金额{else/}服务金额{/eq}：</label>
                                        <div class="col-md-1 " >
                                            <input type="text" placeholder="请填写订单总额" {neq name="$item.status" value="50"}readonly{/neq}
                                            class="form-control col-md-7 col-xs-12" name="amount"
                                            value="{$item.order_price|default=''}" datatype="*" nullmsg="请填写订单总额"
                                            >
                                        </div>
                                        {eq name="$item.single_id" value="11"}<span style="position: relative;bottom:-8px;">寄存金额为0 就是免费寄存</span>{else/}{/eq}

                                    </div>

                                    {eq name="$item.single_parent_id" value="1"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车船使用税：</label>
                                        <div class="col-md-1 " >
                                            <input type="text" placeholder="填写车船使用费" onchange=""
                                                   class="form-control col-md-7 col-xs-12" name="sj" {neq name="$item.status" value="50"}readonly{/neq}
                                            value="{$item.sj|default=''}" datatype="*" nullmsg="请填写运费金额"
                                            >
                                        </div>
                                    </div>
                                    {/eq}

                                    {if condition="$item.single_id eq 11"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">轮胎寄存时间：</label>
                                        <div class="col-md-6 ">
                                            <input type="text" placeholder="请选择时间区间"
                                                   class="form-control col-md-7 col-xs-12" name="interval_timer"
                                                   id="interval_timer"
                                                   {notempty name="$item.start_time"}
                                                   value="{$item.start_time} / {$item.end_time}"
                                                   {/notempty}
                                            datatype="*"
                                            nullmsg="请选择时间区间" errormsg="请选择时间区间！"
                                            >
                                        </div>
                                    </div>

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">轮胎组图【640*480】:</label>
                                        <div class="col-md-6 ">
                                            <!--160*120-->
                                            <div class="uploader white">
                                                <input type="button" id="logo_upload_btn" class="button" value="批量上传"/>
                                            </div>

                                            <div id="logo_upload_area" style='width:80%'>
                                                <div id='photos_area' class="photos_area clearfix ">

                                                    {if condition="($Request.action eq 'update') && ($item.multi_pic neq 'N;')"}
                                                    {foreach :unserialize($item['multi_pic']) as $picValue}
                                                    <div class="item form-group" data-am-widget="gallery" class="am-gallery am-avg-sm-2
am-avg-md-3 am-avg-lg-4 am-gallery-overlay" data-am-gallery="{ pureview: true }">
                                                        <input type="hidden" name="picArr[]" value="{$picValue}">
                                                        <img src="__PUBLIC__/{$picValue}" width="100px" height="100px">
                                                        <div class="operate">
                                                            <i class="toleft">左移</i>
                                                            <i class="toright">右移</i>
                                                            <i class="del">删除</i>
                                                        </div>
                                                    </div>
                                                    {/foreach}
                                                    {/if}

                                                </div>
                                                <div class="alert alert-success" role="alert"
                                                     style="margin:10px 0;"><strong><span
                                                        class="glyphicon glyphicon-flag"></span>点击批量上传按钮上传多张图片:</strong>&nbsp;&nbsp;单张图片大小不超过500KB,格式为jpg,png,gif,jpeg
                                                </div>

                                            </div>

                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">轮胎是否取走状态：</label>
                                        <div class="col-md-3 " style="padding-top: 8px;" >
                                            {switch name="$item.take_tyre"}
                                            {case 5}等待审核{/case}
                                            {case 3}前台确认轮胎是否已寄存{/case}
                                            {case 1}已寄存{/case}
                                            {case 4}前台确认轮胎是否已取走{/case}
                                            {case 2}已取走{/case}


                                            {/switch}
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">取走时间：</label>
                                        <div class="col-md-3 " style="padding-top: 8px;" >
                                           {$item.take_tyre_time}
                                        </div>
                                    </div>

                                    {/if}
                                    <!--{if condition="$item.single_id eq 11"}-->
                                    <!--{in name="$item.status" value="4,5"}-->

                                    <!--<div class="form-group">-->
                                    <!--<label class="control-label col-md-3 ">寄存时间：</label>-->
                                    <!--<div class="col-md-3 " style="margin-top: 10px;">-->
                                    <!--{$item.start_time}-{$item.end_time}-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--<div class="form-group">-->
                                    <!--<label class="control-label col-md-3 ">轮胎组图：</label>-->
                                    <!--<div class="col-md-6  example" style="margin-top: 10px;">-->
                                    <!--{if condition="($Request.action eq 'update') && ($item.multi_pic neq 'N;')"}-->
                                    <!--{foreach :unserialize($item['multi_pic']) as $picValue}-->
                                    <!--<img class="" src="/{$picValue}" width="180" height="110" onerror="this.src='/default_img.png'">-->

                                    <!--{/foreach}-->
                                    <!--{/if}-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--<div class="form-group">-->
                                    <!--<label class="control-label col-md-3 ">寄存备注：</label>-->
                                    <!--<div class="col-md-3 " style="margin-top: 10px;">-->
                                    <!--{$item.remark|default=''}-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--{/in}-->
                                    <!--{/if}-->
                                    {neq name="$item.single_id" value="11"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">运费金额：</label>
                                        <div class="col-md-1 " >
                                            <input type="text" placeholder="填写运费就是上门配送" onchange=""
                                                   class="form-control col-md-7 col-xs-12" name="freight" {neq name="$item.status" value="50"}readonly{/neq}
                                            value="{$item.freight|default=''}" datatype="*" nullmsg="请填写运费金额"
                                            >
                                        </div><span style="position: relative;bottom:-8px;">填写大于0的运费金额 就是上门服务</span>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">联系人：</label>
                                        <div class="col-md-3 " >
                                            <input type="text" placeholder="请填写联系人"
                                                   class="form-control col-md-7 col-xs-12" name="shipping_name" {neq name="$item.status" value="50"}readonly{/neq}
                                            value="{$item.shipping_name|default=''}"
                                            >
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">联系人手机号：</label>
                                        <div class="col-md-3 " >
                                            <input type="text" placeholder="请填写联系人手机号" {neq name="$item.status" value="50"}readonly{/neq}
                                            class="form-control col-md-7 col-xs-12" name="shipping_phone"
                                            value="{$item.shipping_phone|default=''}"
                                            >
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">配送区域：</label>
                                        <div class="col-md-3 " >
                                            <input type="text" placeholder="请填写配送区域" {neq name="$item.status" value="50"}readonly{/neq}
                                            class="form-control col-md-7 col-xs-12" name="shipping_province"
                                            value="{$item.shipping_province|default=''}"
                                            >
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">配送详细地址：</label>
                                        <div class="col-md-4 " >
                                            <input type="text" placeholder="请填写配送详细地址" {neq name="$item.status" value="50"}readonly{/neq}
                                            class="form-control col-md-7 col-xs-12" name="shipping_address"
                                            value="{$item.shipping_address|default=''}"
                                            >
                                        </div>
                                    </div>
                                    {/neq}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">服务方式：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                            {switch name="item.shipping"}
                                            {case 1}商家配送{/case}
                                            {case 2}到店自取{/case}
                                            {/switch}
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">预约开始时间：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div><input type="text" style="width: 150px;" onClick="WdatePicker()"
                                                        class="form-control col-md-7 col-xs-12" name="yuyue_start_time"
                                                        value="{$item.yuyue_start_time|default=''}"
                                            >
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">预约结束时间：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div><input type="text" style="width: 150px;" onClick="WdatePicker()"
                                                        class="form-control col-md-7 col-xs-12" name="yuyue_end_time"
                                                        value="{$item.yuyue_end_time|default=''}"
                                            >
                                            </div>
                                        </div>
                                    </div>

                                    {in name="$item.status" value="10,11,12"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">退款金额：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$refund.amount}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">退款理由：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$refund.title}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">退款说明：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$refund.explain}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    {/in}

                                    {in name="$item.service_type_id" value="1,2"}
                                    {eq name="$item.service_type_id" value="1"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">投保险种：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{:implode(' ',$item.service_info.type_id_name)}</div>
                                        </div>
                                    </div>
                                    {/eq}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">
                                            {eq name="$item.single_parent_id" value="2"}送检人员{/eq}
                                            {eq name="$item.single_parent_id" value="1"}被保险人{/eq}：
                                        </label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.protecteder}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">手机号码：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.phone}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车主姓名：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.plat_name}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车牌号码：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.plat_number}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">车辆识别码：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.plat_code}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">发动机号：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.engine_number}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">品牌型号：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.brand_number}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">注册日期：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.service_info.register_time}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                        </div>
                                    </div>

                                    <div class="form-group tc" data-am-widget="gallery" class="am-gallery am-avg-sm-2
am-avg-md-3 am-avg-lg-4 am-gallery-overlay" data-am-gallery="{ pureview: true }">
                                        <label class="control-label col-md-3 ">身份证：</label>
                                        <div class="col-md-6  example" style="margin-top: 10px;">
                                            <img class="" src="/{$item.service_info.protecter_face}" width="180" height="110" onerror="this.src='/default_img.png'"> <img class="smallimg" src="/{$item.service_info.protecter_back}" width="180" height="110" onerror="this.src='/default_img.png'">
                                        </div>
                                    </div>

                                    <div class="form-group tc" class="form-group" data-am-widget="gallery" class="am-gallery am-avg-sm-2
am-avg-md-3 am-avg-lg-4 am-gallery-overlay" data-am-gallery="{ pureview: true }">
                                        <label class="control-label col-md-3 ">行驶证：</label>
                                        <div class="example col-md-6 " style="margin-top: 10px;">
                                            <img class="" src="/{$item.service_info.car_face}" width="180" height="110" onerror="this.src='/default_img.png'"> <img class="smallimg" src="/{$item.service_info.car_back}" width="180" height="110" onerror="this.src='/default_img.png'">
                                        </div>
                                    </div>
                                    {/in}

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">订单状态：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                            {switch name="item.status"}
                                            {case 50}等待沟通{/case}
                                            {case 1}未支付{/case}
                                            {case 6}进行中{/case}
                                            {case 5}已确认{/case}
                                            {case 4}已评价{/case}
                                            {case 10}退款中{/case}
                                            {case 11}退款成功{/case}
                                            {case 12}退款失败{/case}
                                            {case 20}已取消({$item.cancel_content}){/case}
                                            {/switch}
                                            <br/>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 ">优惠券使用情况：</label>
                                        <div class="col-md-4">
                                            {if condition="$item.coupon_id gt 0"}
                                            <div style="margin-top: 8px;"> ID:{$item.coupon_id} 标题 : {$item.coupon_title}-满 : {$item.coupon_totol_price} 元 - {$item.coupon_price} 元</div>
                                            {elseif condition="$item.coupon_id eq 0 && $item.status eq 1 && $item.amount gt 0" /}
                                            <select {if condition="session('role_id') neq 1"} disabled{/if} onChange="use_coupon({$item.id},this.value,{$item.member_id})" name="shop_id123" class="select2_single form-control" style="width: 440px;float: left;" tabindex="-1">
                                                <option value="0">请选择优惠券</option>
                                                {volist name="member_coupon" id="vo"}
                                                <option value="{$vo.id}" >{$vo.title}-满{$vo.total_price}元减{$vo.minus_price}元</option>
                                                {/volist}
                                            </select>
                                            {/if}
                                        </div>
                                    </div>

                                    <script>
                                        function use_coupon(order_id,member_coupon_id,member_id) {

                                            if(member_coupon_id > 0){
                                                $.ajax({
                                                    type: "POST",
                                                    url: "{:url('service_order/use_coupon_service')}",
                                                    data: {order_id:order_id,member_coupon_id:member_coupon_id,member_id:member_id},
                                                    dataType: "json",
                                                    success: function(ret){
                                                        //ret == true == 1/*?*/
                                                        if(ret.code == 200){
                                                            console.log(ret);
                                                            layer.msg('使用成功');
                                                            history.go(0);
                                                        }
                                                        else{
//                                                            layer.msg('失败');
//                                                            history.go(0);
                                                        }
                                                    }

                                                });
                                            }else{
                                                alert('失败');
                                            }
                                        }
                                    </script>

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">订单金额：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>{$item.amount}</div>
                                        </div>
                                    </div>
                                    {if condition="$item.single_id eq 11 && strpos('5,4',(string)$item.status) !== false"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">轮胎是否取走：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                            {switch name="$item.take_tyre"}
                                            {case 2}已取走{/case}
                                            {case 1}未取走{/case}
                                            {/switch}
                                            <br/>
                                        </div>
                                    </div>
                                    {/if}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">是否开发票：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            {switch name="item.bill"}{case 1}开{/case}{case 2} 否{/case}{default /}{/switch}<br>
                                            {eq name="$item.bill" value="1"}
                                            发票类型：{switch name="item.bill_type"}{case 1}电子{/case}{case 2} 普通{/case}{case 3} 增值税{/case}{default /}{/switch}<br>
                                            发票抬头：{switch name="item.bill_header"}{case 1}个人{/case}{case 2} 单位{/case}{default /}{/switch}<br>
                                            发票内容：{$item.bill_content}<br>
                                            发票电话：{$item.bill_phone}<br>
                                            电子邮箱：{$item.bill_email}<br>

                                            {/eq}
                                        </div>
                                    </div>

                                    {if condition="$item.status eq 6 && $auding_status eq 1" }
                                    <div class="form-group service_people" id="service_people">
                                        <label class="control-label col-md-3 ">服务人员提成：</label>
                                        <div class="col-md-7 ">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>提成类型</th>
                                                <th>服务人员</th>
                                                <th >服务分类</th>
                                                <th>服务内容</th>
                                                <th>服务金额</th>
                                                <th>是否同意</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                                </thead>

                                                <tbody id="fieldtr">
                                                {volist name="shop_assignor_records" id="list"}
                                                <tr>
                                                    <td>{$list.type}</td>
                                                    <td >
                                                        <select name="assignor_id[]" style="width: 100px;" class="form-control" tabindex="-1" disabled>
                                                            {volist name="$shop_assignor" id="li"}
                                                            <option value="{$li.id}" {eq name="$li.id" value="$list.assignor_id"}selected{/eq}>{$li.name}</option>
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <td><input type="text" name="assignor_price[]" value="{$list.assignor_price}"  disabled/></td>
                                                    <td><input type="text" name="assignor_content[]" style="width:100px;" value="{$list.assignor_content}"  disabled/></td>
                                                    <td><input type="text" name="assignor_content[]" style="width:100px;" value="{$list.assignor_price}"  disabled/></td>
                                                    <td>{eq name="list.is_agree" value="1"}未同意{else/}已同意{/eq}</td>
                                                    <td><input type="text" name="create_time[]" style="width:100px;" value="{$list.create_time}"  disabled/></td>
                                                    <td><a href="javascript:;" onClick="delThis($(this),{$list.id})" ></a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="8"><a href="javascript:;" class="addNewTr" title="新增一条" >新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="form-group tc " id="service_people">
                                        <label class="control-label col-md-3 ">商品添加：</label>
                                        <div class="col-md-8 ">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>商品分类</th>
                                                <th>商品规格</th>
                                                <th>商品数量</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtrgoods">
                                                {volist name="service_order_goods" id="list"}
                                                <tr>
                                                    <td>
                                                        <select name="cat_id[]" class="form-control" tabindex="-1" disabled>
                                                            <option value="0">全部分类</option>
                                                            {volist name=":json_decode($category,true)" id="shopClassData"}
                                                            <option
                                                                    value="{$shopClassData.id}"
                                                                    {eq name='list.cat_id' value='$shopClassData.id'}
                                                                    selected
                                                                    {/eq}
                                                            >
                                                            {neq name="shopClassData.parenTid" value="0"}
                                                            {:str_repeat('　',$shopClassData['count'])}
                                                            {/neq}
                                                            {eq name="shopClassData.parenTid" value="0"}
                                                            <span>&nbsp;</span>
                                                            {else /}
                                                            <span>&nbsp;</span>
                                                            {/eq}
                                                            {neq name="shopClassData.count" value="1"}|&nbsp;--&nbsp;{/neq}
                                                            {$shopClassData.title}
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <td><select class="form-control" tabindex="-1" name="spec_id[]" disabled>
                                                        {volist name=":json_decode($spec_attr_list,true)" id="g"}
                                                        <option value="{$g.id}" {eq name='$list.spec_id' value='$g.id'}selected{/eq}>|--{$g.title}-{$g.attribute}-{$g.inventory}</option>
                                                        {/volist}
                                                    </select>
                                                    </td>
                                                    <td>
                                                        <input name="number" value="{$list.number}" disabled>
                                                    </td>
                                                    <td>
                                                        {$list.create_time}
                                                    </td>


                                                    <td><a href="javascript:;" onClick="delThigoods($(this),{$list.spec_id})" >删除</a></td>
                                                </tr>

                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="6"><a href="javascript:;" class="addNewTrgoods" title="新增一条" >新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    {/if}
                                    {if condition="($item.status eq 5 || $item.status eq 4 || $item.status eq 1 ) && $auding_status eq 1" }
                                    <div class="form-group tc service_people" id="service_people">
                                        <label class="control-label col-md-3 ">服务人员提成：</label>
                                        <div class="col-md-6 ">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>提成类型</th>
                                                <th>服务人员</th>
                                                <th>服务分类</th>
                                                <th>服务内容</th>
                                                <th>服务提成</th>
                                                <th>是否同意</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtr">
                                                {volist name="shop_assignor_records" id="list"}
                                                <tr><td>{$list.type}</td>
                                                    <td>
                                                        <select name="assignor_id[]" style="width: 100px;" class="form-control" tabindex="-1" disabled>
                                                            {volist name="$shop_assignor" id="li"}
                                                            <option value="{$li.id}" {eq name="$li.id" value="$list.assignor_id"}selected{/eq}>{$li.name}</option>
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <!--<td><input type="text" name="assignor_id[]" style="width:100px;" value="{$list.assignor_id}" disabled /></td>-->
                                                    <td><input type="text"  name="assignor_price[]"  value="{$list.cat_name}"  disabled/></td>
                                                    <td><input type="text" name="assignor_content[]" disabled style="width:100px;" value="{$list.assignor_content}"  /></td>
                                                    <td><input type="text" name="assignor_price[]"  disabled value="{$list.assignor_price}"  disabled/></td>
                                                    <td>{eq name="list.is_agree" value="1"}未同意{else/}已同意{/eq}</td>
                                                    <td><input type="text" name="create_time[]" style="width:100px;" value="{$list.create_time}"  disabled/></td>
                                                    <td><a href="javascript:;" onClick="delThis($(this),{$list.id})" ></a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="8"><a href="javascript:;" class="addNewTr" title="新增一条" >新增一条</a></td>
                                                </tr>
                                                </tbody>

                                            </table>
                                        </div>
                                    </div>

                                    <div class="form-group tc" id="service_people">
                                        <label class="control-label col-md-3 ">商品添加：</label>
                                        <div class="col-md-8 ">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>商品分类</th>
                                                <th>商品规格</th>
                                                <th>商品数量</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtr">
                                                {volist name="service_order_goods" id="list"}
                                                <tr>
                                                    <td>
                                                        <select name="assignor_id[]" class="form-control" tabindex="-1" disabled>
                                                            <option value="0">全部分类</option>
                                                            {volist name=":json_decode($category,true)" id="shopClassData"}
                                                            <option
                                                                    value="{$shopClassData.id}"
                                                                    {eq name='list.cat_id' value='$shopClassData.id'}
                                                                    selected
                                                                    {/eq}
                                                            >
                                                            {neq name="shopClassData.parenTid" value="0"}
                                                            {:str_repeat('　',$shopClassData['count'])}
                                                            {/neq}
                                                            {eq name="shopClassData.parenTid" value="0"}
                                                            <span>&nbsp;</span>
                                                            {else /}
                                                            <span>&nbsp;</span>
                                                            {/eq}
                                                            {neq name="shopClassData.count" value="1"}|&nbsp;--&nbsp;{/neq}
                                                            {$shopClassData.title}
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <td><select class="form-control" disabled>
                                                        {volist name=":json_decode($spec_attr_list,true)" id="g"}
                                                        <option value="{$g.id}" {eq name="$g.id" value="$list.spec_id"}selected{/eq}>|--{$g.title}-{$g.attribute}-{$g.inventory}</option>
                                                        {/volist}
                                                    </select>
                                                    </td>
                                                    <td>
                                                        {$list.number}
                                                    </td>
                                                    <td>
                                                        {$list.create_time}
                                                    </td>

                                                    <td><a href="javascript:;" onClick="delThis($(this),{$list.id})" ></a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>

                                    {/if}
                                    <!--20190208x修改  去掉|| $item.status eq 1加上6-->
                                    {if condition="($item.status eq 6 || $item.status eq 5 || $item.status eq 4  ) && $auding_status eq 2" }
                                    <div class="form-group service_people"  id="service_people">
                                        <label class="control-label col-md-3 ">服务人员提成：</label>
                                        <div class="col-md-8 ">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>提成类型</th>
                                                <th>服务人员</th>
                                                <th>服务分类</th>
                                                <th>服务内容</th>
                                                <th>提成金额</th>
                                                <th>是否同意</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtr">
                                                {volist name="shop_assignor_records" id="list"}
                                                <tr>
                                                    <td>{$list.type}</td>
                                                    <td>
                                                        <select name="assignor_id[]" style="width: 100px;" class="form-control" tabindex="-1" disabled>
                                                            {volist name="$shop_assignor" id="li"}
                                                            <option value="{$li.id}" {eq name="$li.id" value="$list.assignor_id"}selected{/eq}>{$li.name}</option>
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <!--<td><input type="text" name="assignor_id[]" style="width:100px;" value="{$list.assignor_id}" /></td>-->
                                                    <td style="padding: 8px 0;"><input type="text" name="assignor_price[]"  value="{$list.cat_name}" disabled  width="100%"/></td>
                                                    <td><input type="text" name="assignor_content[]" style="width:100px;" value="{$list.assignor_content}"  disabled/></td>
                                                    <td><input type="text" name="assignor_price[]"  value="{$list.assignor_price}" disabled /></td>
                                                    <td>{eq name="list.is_agree" value="1"}未同意{else/}已同意{/eq}</td>
                                                    <td><input type="text" name="create_time[]"  value="{$list.create_time}" disabled /></td>
                                                    <td><a href="javascript:;" onClick="delThis($(this),{$list.id})" >删除</a></td>
                                                </tr>
                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="8"><a href="javascript:;" class="addNewTr" title="新增一条" >新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="form-group tc" id="service_people">
                                        <label class="control-label col-md-3 ">商品添加：</label>
                                        <div class="col-md-8 ">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <th>商品分类</th>
                                                <th>商品规格</th>
                                                <th>商品数量</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                                </thead>
                                                <tbody id="fieldtrgoods">
                                                {volist name="service_order_goods" id="list"}
                                                <tr>
                                                    <td>
                                                        <select name="cat_id[]" class="form-control" tabindex="-1" disabled>
                                                            <option value="0">全部分类</option>
                                                            {volist name=":json_decode($category,true)" id="shopClassData"}
                                                            <option
                                                                    value="{$shopClassData.id}"
                                                                    {eq name='list.cat_id' value='$shopClassData.id'}
                                                                    selected
                                                                    {/eq}
                                                            >
                                                            {neq name="shopClassData.parenTid" value="0"}
                                                            {:str_repeat('　',$shopClassData['count'])}
                                                            {/neq}
                                                            {eq name="shopClassData.parenTid" value="0"}
                                                            <span>&nbsp;</span>
                                                            {else /}
                                                            <span>&nbsp;</span>
                                                            {/eq}
                                                            {neq name="shopClassData.count" value="1"}|&nbsp;--&nbsp;{/neq}
                                                            {$shopClassData.title}
                                                            {/volist}
                                                        </select>
                                                    </td>
                                                    <td><select class="form-control" tabindex="-1" name="spec_id[]" disabled>
                                                        {volist name=":json_decode($spec_attr_list,true)" id="g"}
                                                        <option value="{$g.id}" {eq name='$list.spec_id' value='$g.id'}selected{/eq}>|--{$g.title}-{$g.attribute}-{$g.inventory}</option>
                                                        {/volist}
                                                    </select>
                                                    </td>
                                                    <td>
                                                        <input name="number" value="{$list.number}" disabled>
                                                    </td>
                                                    <td>
                                                        {$list.create_time}
                                                    </td>


                                                    <td><a href="javascript:;" onClick="delThigoods($(this),{$list.spec_id})" >删除</a></td>
                                                </tr>

                                                {/volist}
                                                </tbody>
                                                <tbody align="right">
                                                <tr>
                                                    <td colspan="5"><a href="javascript:;" class="addNewTrgoods" title="新增一条" >新增一条</a></td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    {/if}
                                    {in name="item.status" value="50,1,6,5,4"}
                                    <div class="form-group tc service_people" id="service_people">
                                        <label class="control-label col-md-3 ">备注信息：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                                <textarea type="text" placeholder="备注" style="width: 500px;height: 100px;" {neq name=":session('role_id')" value="1"}readonly{/neq}
                                                          class="form-control col-md-7 col-xs-12" name="explain">{$item.explain|default=''}</textarea>

                                        </div>
                                    </div>
                                    {/in}
                                    {eq name="$item.single_id" value="11"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">是否已发起取走审核：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <div>
                                                {switch name="$item.faqi"}
                                                {case 1}未发起{/case}
                                                {case 2}已发起{/case}
                                                {/switch}
                                            </div>
                                        </div>
                                    </div>
                                    {/eq}

                                    {if condition="$item.is_free_order eq 2"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">免费订单审核：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <tr><th>审核状态</th><th>一级审核</th><th>二级审核</th><th>三级审核</th></tr>
                                                </thead>
                                                <tbody>
                                                <tr>
                                                    <td class="td0">
                                                        {switch name="$item.auding_status"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td1">
                                                        {switch name="$item.auding_status1"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td2">
                                                        {switch name="$item.auding_status2"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td3">
                                                        {switch name="$item.auding_status3"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        {if condition="(session('role_id') eq 1 || session('role_id') eq 2 || session('role_id') eq 11) && ($item.auding_status eq 1 || $item.auding_status eq 3)"}
                                                        <input type="checkbox" id="checkbox41_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status1}" {eq name="item['auding_status1']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_order({$item['id']},'auding_status1')"
                                                               for="checkbox41_{$item.id}"></label>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if condition="session('role_id') eq 12 && $item.auding_status1 eq 2 && ($item.auding_status eq 1 || $item.auding_status eq 3)"}
                                                        <input type="checkbox" id="checkbox42_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status2}" {eq name="item['auding_status2']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_order({$item['id']},'auding_status2')"
                                                               for="checkbox42_{$item.id}"></label>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if condition="session('role_id') eq 13 && $item.auding_status2 eq 2 && $item.auding_status1 eq 2 && $item.auding_status eq 1"}
                                                        <input type="checkbox" id="checkbox43_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status3}" {eq name="item['auding_status3']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_order({$item['id']},'auding_status3')"
                                                               for="checkbox43_{$item.id}"></label>
                                                        {/if}
                                                    </td>

                                                </tr>
                                                </tbody>
                                            </table>

                                        </div>
                                    </div>
                                    <script>
                                        function auding_orderf(id,auding_status){
                                            var reason = $('[name="reason"]').val();
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('order/auding_orderf')}",
                                                data: {id:id,auding_status:auding_status,reason:reason},
                                                dataType: "json",
                                                success: function(ret){
                                                    //ret == true == 1/*?*/
                                                    if(ret == 2){
                                                        console.log(ret);
                                                        layer.msg('审核成功');
                                                        history.go(0);
                                                    }
                                                    else{
                                                        layer.msg('等待审核');
                                                        history.go(0);
                                                    }
                                                }

                                            });
                                        }
                                    </script>
                                    {if condition="($item.auding_status eq 1 || $item.auding_status eq 3)"}
                                    <div class="form-group tc">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 ">失败原因：</label>
                                            <div class="col-md-6 ">
                                                <textarea name="reason" rows="5" style="width: 300px;">{$item.reason|default=''}</textarea>
                                            </div>
                                        </div>
                                    </div>
                                    {/if}
                                    {/if}

                                    {if condition="strpos('6,5,4',(string)$item.status) !== false && $item.single_id == 11"}
                                    <!--轮胎寄存审核后(确认寄存)通知-->
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">轮胎寄存审核后(确认寄存)通知：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <tr><th>审核状态</th><th>一级审核</th><th>二级审核</th><th>三级审核</th></tr>
                                                </thead>
                                                <tbody>
                                                <tr>
                                                    <td class="td0">
                                                        {switch name="$item.auding_statusf"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td1">
                                                        {switch name="$item.auding_status1f"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td2">
                                                        {switch name="$item.auding_status2f"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td3">
                                                        {switch name="$item.auding_status3f"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        {if condition="(session('role_id') eq 1 || session('role_id') eq 2 || session('role_id') eq 11) && ($item.auding_statusf eq 1 || $item.auding_statusf eq 3)"}
                                                        <input type="checkbox" id="checkbox41f_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status1f}" {eq name="item['auding_status1f']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_orderf({$item['id']},'auding_status1f')"
                                                               for="checkbox41f_{$item.id}"></label>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if condition="session('role_id') eq 12 && $item.auding_status1f eq 2 && ($item.auding_statusf eq 1 || $item.auding_statusf eq 3)"}
                                                        <input type="checkbox" id="checkbox42f_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status2}" {eq name="item['auding_status2f']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_orderf({$item['id']},'auding_status2f')"
                                                               for="checkbox42f_{$item.id}"></label>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if condition="session('role_id') eq 13 && $item.auding_status2f eq 2 && $item.auding_status1f eq 2 && $item.auding_statusf eq 1"}
                                                        <input type="checkbox" id="checkbox43f_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status3f}" {eq name="item['auding_status3f']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_orderf({$item['id']},'auding_status3f')"
                                                               for="checkbox43f_{$item.id}"></label>
                                                        {/if}
                                                    </td>

                                                </tr>
                                                </tbody>
                                            </table>

                                        </div>
                                    </div>
                                    <script>
                                        function auding_orderf(id,auding_status){
                                            var reason = $('[name="reasonf"]').val();
//                                            alert(reason);
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('order/auding_orderf')}",
                                                data: {id:id,auding_status:auding_status,reason:reason},
                                                dataType: "json",
                                                success: function(ret){
                                                    //ret == true == 1/*?*/
                                                    if(ret == 2){
                                                        console.log(ret);
                                                        layer.msg('审核成功');
                                                        history.go(0);
                                                    }
                                                    else{
                                                        layer.msg('等待审核');
                                                        history.go(0);
                                                    }
                                                }

                                            });
                                        }
                                    </script>
                                    {if condition="($item.auding_statusf eq 1 || $item.auding_statusf eq 3)"}
                                    <div class="form-group tc">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 ">轮胎寄存审核后(确认寄存)通知失败原因：</label>
                                            <div class="col-md-6 ">
                                                <textarea name="reasonf" rows="5" style="width: 300px;">{$item.reasonf|default=''}</textarea>
                                            </div>
                                        </div>
                                    </div>
                                    {/if}
                                    <!--轮胎寄存审核后(确认寄存)通知-->
                                    <!--轮胎寄存审核后(确认取走)通知-->
                                    {if condition="in_array($item.take_tyre,[1,4,2]) && $item.faqi eq 2"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">轮胎寄存审核后(确认取走)通知：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <table class="table table-striped table-bordered table-hover">
                                                <thead>
                                                <tr><th>审核状态</th><th>一级审核</th><th>二级审核</th><th>三级审核</th></tr>
                                                </thead>
                                                <tbody>
                                                <tr>
                                                    <td class="td0">
                                                        {switch name="$item.auding_statusq"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td1">
                                                        {switch name="$item.auding_status1q"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td2">
                                                        {switch name="$item.auding_status2q"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td class="td3">
                                                        {switch name="$item.auding_status3q"}
                                                        {case 1}等待审核{/case}
                                                        {case 2}审核成功{/case}
                                                        {case 3}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        {if condition="(session('role_id') eq 1 || session('role_id') eq 2 || session('role_id') eq 11) && ($item.auding_statusq eq 1 || $item.auding_statusq eq 3)"}
                                                        <input type="checkbox" id="checkbox41q_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status1q}" {eq name="item['auding_status1q']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_orderq({$item['id']},'auding_status1q')"
                                                               for="checkbox41q_{$item.id}"></label>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if condition="session('role_id') eq 12 && $item.auding_status1q eq 2 && ($item.auding_statusq eq 1 || $item.auding_statusq eq 3)"}
                                                        <input type="checkbox" id="checkbox42q_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status2q}" {eq name="item['auding_status2q']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_orderq({$item['id']},'auding_status2q')"
                                                               for="checkbox42q_{$item.id}"></label>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if condition="session('role_id') eq 13 && $item.auding_status2q eq 2 && $item.auding_status1q eq 2 && $item.auding_statusq eq 1"}
                                                        <input type="checkbox" id="checkbox43q_{$item.id}" class="chk_3"
                                                               value="{$item.auding_status3q}" {eq name="item['auding_status3q']" value="2"}checked{/eq} />
                                                        <label style="margin-left: 30px;margin-top: 5px;"
                                                               onclick="auding_orderq({$item['id']},'auding_status3q')"
                                                               for="checkbox43q_{$item.id}"></label>
                                                        {/if}
                                                    </td>

                                                </tr>
                                                </tbody>
                                            </table>

                                        </div>
                                    </div>

                                    <script>

                                        function auding_orderq(id,auding_status){
                                            var reason = $('[name="reasonq"]').val();
                                            $.ajax({
                                                type: "POST",
                                                url: "{:url('order/auding_orderq')}",
                                                data: {id:id,auding_status:auding_status,reason:reason},
                                                dataType: "json",
                                                success: function(ret){
                                                    //ret == true == 1/*?*/
                                                    if(ret == 2){
                                                        console.log(ret);
                                                        layer.msg('审核成功');
                                                        history.go(0);
                                                    }
                                                    else{
                                                        layer.msg('等待审核');
                                                        history.go(0);
                                                    }
                                                }

                                            });
                                        }


                                    </script>
                                    {if condition="($item.auding_statusq eq 1 || $item.auding_statusq eq 3)"}
                                    <div class="form-group tc">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 ">轮胎寄存审核后(确认取走)通知失败原因：</label>
                                            <div class="col-md-6 ">
                                                <textarea name="reasonq" rows="5" style="width: 300px;">{$item.reasonq|default=''}</textarea>
                                            </div>
                                        </div>
                                    </div>
                                    {/if}
                                    {/if}
                                    <!--轮胎寄存审核后(确认取走)通知-->
                                    {/if}
                                        <!--轮胎寄存分类if-->
                                    {in name="item.status" value="50,1,6,5,4"}
                                    {eq name="$item.single_id" value="11"}
                                    <div class="form-group tc service_people" id="service_people">
                                        <label class="control-label col-md-3 ">(轮胎)审核员备注信息：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                            <textarea type="text" placeholder="备注" style="width: 500px;height: 100px;"
                                            class="form-control col-md-7 col-xs-12" name="single_explain" {if condition="in_array(session('role_id'),['1','2','11','12','13']) && $item.single_id eq 11 "}{else/} disabled{/if}>{$item.single_explain|default=''}</textarea>

                                        </div>
                                    </div>
                                    {/eq}
                                    {/in}


                                    {if condition="strpos('11,10,12',(string)$item.status) !== false"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">退款审核记录：</label>
                                        <div class="col-md-6 " style="margin-top: 10px;">
                                            <table width="80%" border="1" style="font-family: '微软雅黑';">
                                                <tr align="center" style="font-size: 16px;">
                                                    <td>申请者</td>
                                                    <td>申请门店</td>
                                                    <td>审核状态</td>
                                                    <td>审核时间</td>
                                                    <td>失败原因</td>
                                                </tr>
                                                {volist name='refund_order_audit_records' id='goods_list'}
                                                <tr align="center">
                                                    <td>{$goods_list.username|default=''}</td>
                                                    <td>{$goods_list.shop_title|default=''}</td>
                                                    <td>
                                                        {switch name="$goods_list.status"}
                                                        {case 11}审核成功{/case}
                                                        {case 12}审核失败{/case}
                                                        {/switch}
                                                    </td>
                                                    <td>{$goods_list.create_time|default=''}</td>
                                                    <td>{$goods_list.fail_explain|default=''}</td>
                                                </tr>
                                                {/volist}
                                            </table>
                                        </div>
                                    </div>
                                    {/if}
                                    {in name="item.status" value="10"}
                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">退款状态：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                            <select name="status" class="form-control" style="width: 200px;float: left;" tabindex="-1" {in name='item.status' value='11,12'}disabled{/in}>
                                            <option value="11" {eq name='item.status' value='11'}selected{/eq}>申请退款审核</option>
                                            <option value="12" {eq name='item.status' value='12'}selected{/eq}>申请退款失败</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group tc">
                                        <label class="control-label col-md-3 ">未退款理由：</label>
                                        <div class="col-md-1 " style="margin-top: 10px;">
                                                <textarea type="text" placeholder="未退款理由,不填写留空" style="width: 500px;height: 100px;"
                                                          class="form-control col-md-7 col-xs-12" name="fail_explain">{$refund_find.message|default=''}</textarea>
                                            <div style="width:500px;clear: both">
                                                <span style="font-size: 16px;color: red">注：只有在退款状态是退款失败的时候填写</span>
                                            </div>
                                        </div>
                                    </div>
                                    {/in}

                            </div>
                                <div class="form-group ">
                                    <label class="control-label col-md-3 " style="text-align: right">是否隐藏会员提成：</label>
                                    <div class="col-md-6 ">
                                        <label class="radio_box">
                                            <input type="radio" name="type" id="status_1" class="cartradio"
                                                   value="1"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default="1"' value='1' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_1"></label>
                                            <span>否</span>
                                            &nbsp;&nbsp;
                                        </label>
                                        <label class="radio_box">
                                            <input type="radio" name="type" id="status_2" class="cartradio"
                                                   value="2"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default=""' value='2' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_2"></label>
                                            <span>是</span>
                                            &nbsp;&nbsp;
                                        </label>
                                    </div>
                                </div>
                                <div style="clear: both"></div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 " style="text-align: right">只保留提成：</label>
                                    <div class="col-md-6 ">
                                        <label class="radio_box">
                                            <input type="radio" name="type2" id="status_3" class="cartradio"
                                                   value="1"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default="1"' value='1' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_3"></label>
                                            <span>否</span>
                                            &nbsp;&nbsp;
                                        </label>
                                        <label class="radio_box">
                                            <input type="radio" name="type2" id="status_4" class="cartradio"
                                                   value="2"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default=""' value='2' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_4"></label>
                                            <span>是</span>
                                            &nbsp;&nbsp;
                                        </label>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-md-6  col-md-offset-3">
                                        {if condition="in_array(session('role_id'),['1','2','11','12','13']) && $item.single_id eq 11 "}
                                        <a onClick="take_audit_shenhe({$item.id})" class="btn btn-primary">(轮胎)审核员备注信息</a>
                                        {/if}
                                        {if condition="in_array(session('role_id'),['11','12','13']) eq false"}
                                        {if condition="session('auding_status') eq 1 && $item.status eq 50"}
                                        <button type="submit" class="btn btn-primary">门店确认金额</button>
                                        {/if}
                                        {if condition="($item.status eq 50 || $item.status eq 1 || $item.status eq 6) && $auding_status eq 2 && strpos('1,2',(string)session('role_id')) !== false"}
                                        <button type="submit" class="btn btn-primary">指派门店</button>
                                        {/if}
                                        {if condition="($item.status eq 50 || $item.status eq 1 || $item.status eq 6) && $auding_status eq 2 && strpos('15',(string)session('role_id')) !== false"}
                                        <button type="submit" class="btn btn-primary">保险员确认</button>
                                        {/if}
                                        {if condition="$item.status eq 6 && $auding_status eq 1 "}
                                        <button type="submit" class="btn btn-primary">门店确认订单</button>
                                        {/if}
                                        {if condition="$item.status eq 5 && $auding_status eq 1 && $item.single_id eq 11 "}
                                        <button type="submit" class="btn btn-primary">(轮胎)门店确认订单</button>
                                        {/if}

                                        {if condition="($item.status eq 5 || $item.status eq 4) && $auding_status eq 2 && strpos('1,2',(string)session('role_id')) !== false"}
                                        <button type="submit" class="btn btn-primary">门店人员再管理</button>
                                        {/if}
                                        {if condition="$auding_status eq 2 && strpos('1,2',(string)session('role_id')) !== false" }
                                        {in name="$item.status" value="50,1"}
                                        <a onClick="cancel({$item.member_id},{$item.id})" class="btn btn-primary">取消订单</a>
                                        {/in}
                                        {/if}

                                        {if condition="$item.take_tyre == 1 && strpos('6,5,4',(string)$item.status) !== false && $item.single_id == 11 && $item.faqi eq 1 && (session('shop_id') eq $item.shop_id || session('manage_id') eq 1)"}
                                        <a type="submit" onClick="take_audit({$item.id})" class="btn btn-primary">门店发起取走审核</a>
                                        {/if}

                                        {if condition="$item.status eq 10 && $refund_button == true && strpos('5,7,8,9,10',(string)session('role_id')) !== false"}
                                        <button type="submit" class="btn btn-primary">退款申请</button>
                                        {/if}
                                        <button type="button"  class="btn btn-danger" id="btnPrint">打印文本区域</button>
                                        <button type="button"  class="btn btn-primary" id="parentIframe">打印表格订单</button>
                                        {/if}
                                        <a type="reset" class="btn btn-success" onClick="history.go(-1)">返回</a>
                                        </form>
                                        {if condition="$item.status eq 10 && session('role_id') eq 1"}
                                        <a onClick="tuikuan({$item.id},11)" class="btn btn-primary">管理员退款成功</a>
                                        <a onClick="tuikuan({$item.id},6)" type="submit" class="btn btn-primary">管理员退款失败</a>
                                        {/if}

                                    </div>
                                </div>
                                <script>
                                    function tuikuan(order_id,status){

                                        $(function(){
                                            var fail_explain = $('[name="fail_explain"]').val();

                                            $.ajax({

                                                type: "POST",

                                                url: "{:url('index/order/tuikuan2')}",

                                                data: {status:status, id:order_id,fail_explain:fail_explain},

                                                dataType: "json",

                                                success: function(data){

                                                    //  $('#resText').empty();   //清空resText里面的所有内容
                                                    //var obj = JSON.parse(data);
                                                    if(data.code == 200){
                                                        layer.msg(data.message);
                                                        history.go(0);
//                                window.location.href = "{:url('index')}"
                                                    }
                                                    else{
                                                        layer.msg(data.message);
                                                    }
                                                    //var html = '';

//                        $.each(data, function(commentIndex, comment){
//
//                            html += '<div class="comment"><h6>' + comment['username']
//
//                                + ':</h6><p class="para"' + comment['content']
//
//                                + '</p></div>';
//
//                        });
//
//                        $('#resText').html(html);

                                                }

                                            });

                                            /// });

                                        });
                                    }

                                    function auding_order(id,auding_status){
                                        var reason = $('[name="reason"]').val();
                                        $.ajax({
                                            type: "POST",
                                            url: "{:url('order/auding_order')}",
                                            data: {id:id,auding_status:auding_status,reason:reason},
                                            dataType: "json",
                                            success: function(ret){
                                                //ret == true == 1/*?*/
                                                if(ret == 2){
                                                    console.log(ret);
                                                    layer.msg('审核成功');
                                                    history.go(0);
                                                }
                                                else{
                                                    layer.msg('等待审核');
                                                    history.go(0);
                                                }
                                            }

                                        });
                                    }
                                    function take_audit_shenhe(id,auding_status){
                                        var single_explain = $('[name="single_explain"]').val();
                                        $.ajax({
                                            type: "POST",
                                            url: "{:url('order/single_explain')}",
                                            data: {id:id,single_explain:single_explain},
                                            dataType: "json",
                                            success: function(ret){
                                                //ret == true == 1/*?*/
                                                if(ret == 2){
                                                    console.log(ret);
                                                    layer.msg('(轮胎)审核员备注成功');
                                                    history.go(0);
                                                }
                                                else{
                                                    layer.msg('失败');
                                                    history.go(0);
                                                }
                                            }

                                        });
                                    }
                                </script>
                                <div class="row">

                                    <div class="x_content col-md-12 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 "
                                                   style="text-align: right">会员付款码：</label>
                                            <div class="col-md-3 ">
                                                <input type="text" placeholder="线下扫码机获得" onchange="" {neq
                                                       name="$item.status" value="1" }disabled{/neq}
                                                class="form-control col-md-7 col-xs-12" name="auth_code"
                                                value="{$item.auth_code|default=''}" datatype="*" nullmsg="请填写运费金额"
                                                >
                                            </div>
                                            {eq name="$item.status" value="1"}
                                            <div class="col-md-6  col-md-offset-3">
                                                <a type="reset" class="btn btn-success" onClick="mic_w_pay()">微信支付</a>
                                                <a type="reset" class="btn btn-success" onClick="mic_a_pay()">支付宝支付</a>
                                                <input type="hidden" name="order_amount" value="{$item.amount}"/>
                                                <input type="hidden" name="order_number" value="{$item.order_number}"/>
                                            </div>
                                            {/eq}
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>


                </div>
                <!-- /page content -->

            </div>

        </div>
    </div>


    {include file="public_foot" /}
    <!-- chk_3 -->
    <link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" href="/zoomify.min.css">

    <script src="/zoomify.min.js"></script>
    <script type="text/javascript">
        //$('.example img').zoomify();
    </script>
    <!-- validform -->
    <script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
    <script src="__STATIC__/js/layer.js"></script>
    <!--select-->
    <script src="__STATIC__/js/select/select2.full.min.js"></script>

    <script>
        $('#parentIframe').click(function(){
            layer.open({
                type: 2,
                area: ['100%', '100%'],
                fixed: false, //不固定
                maxmin: true,
                content: 'http://lihai.xmdonkey.com/index.php/console/service_order/update_dayin/id/'+"{:input('id')}"+'/is_certification_text/'+"{:input('is_certification_text')}"
            });
        });
        function mic_w_pay() {
            var auth_code = $("[name='auth_code']").val();
            var out_trade_no = $("[name='order_number']").val();
            var price = $("[name='order_amount']").val();
            if(!auth_code){
                layer.msg('付款码不能为空');
                return;
            }
            $.ajax({
                type: "POST",
                url: "{:url('mic/w_pay')}",
                data: {auth_code:auth_code, out_trade_no:out_trade_no,price:price},
                dataType: "json",
                success: function(ret){
                    if(ret == true){
                        console.log(ret);
                        layer.msg('支付成功');
                        history.go(0);
                    }
                    else{
                        layer.msg('支付失败');
                    }
                }

            });
        }

        function mic_a_pay() {

            var auth_code = $("[name='auth_code']").val();
            var out_trade_no = $("[name='order_number']").val();
            var price = $("[name='order_amount']").val();

            if(!auth_code){
                layer.msg('付款码不能为空');
                return;
            }

            $.ajax({
                type: "POST",
                url: "{:url('mic/a_pay')}",
                data: {auth_code:auth_code, out_trade_no:out_trade_no,price:price},
                dataType: "json",
                success: function(ret){
                    if(ret == true){
                        layer.msg('支付成功');
                        history.go(0);
                    }
                    else{
                        layer.msg('支付失败');
                    }
                }

            });
        }
        $('.tt').click(function(){
            //$(this).toggleClass('max');
            // $(this).toggleClass('min');
        });
        function cancel(member_id,order_id){

            // $(function(){ 不取消 ajax失效 这么回事呢？
//            var member_id = member_id;
            //var order_id = order_id;
            //$('#send').click(function(){

            $.ajax({
                type: "POST",
                url: "{:url('index/order/cancel')}",
                data: {member_id:member_id, order_id:order_id},
                dataType: "json",
                success: function(data){

                    console.log(1);
                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg('订单取消成功');
                        history.go(0);
                        window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg(data.message);
                    }
                    //var html = '';

//                        $.each(data, function(commentIndex, comment){
//
//                            html += '<div class="comment"><h6>' + comment['username']
//
//                                + ':</h6><p class="para"' + comment['content']
//
//                                + '</p></div>';
//
//                        });
//
//                        $('#resText').html(html);

                }

            });

            /// });

            //});
        }

        function take_audit(order_id){

            // $(function(){ 不取消 ajax失效 这么回事呢？
//            var member_id = member_id;
            //var order_id = order_id;
            //$('#send').click(function(){

            $.ajax({
                type: "POST",
                url: "{:url('console/service_order/take_tyre')}",
                data: {order_id:order_id},
                dataType: "json",
                success: function(data){
                    console.log(data);
                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg('门店发起取走审核成功');
                        history.go(0);
                        //window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg('设置失败');
                    }
                }
            });

        }
        function take(order_id){

            // $(function(){ 不取消 ajax失效 这么回事呢？
//            var member_id = member_id;
            //var order_id = order_id;
            //$('#send').click(function(){

            $.ajax({
                type: "POST",
                url: "{:url('console/service_order/take_tyre')}",
                data: {order_id:order_id},
                dataType: "json",
                success: function(data){
                    console.log(data);
                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg('轮胎已设置取走');
                        history.go(0);
                        //window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg('设置失败');
                    }
                }
            });

        }
    </script>
    <script>
        $('.zoomify').each(function(){
            var zoomed = $(this).hasClass('zoomed');
            if(zoomed == true){
                // alert(1);
                $(this).css("width","1000px");
            }
        });
        // validform
        $(function () {

            $.Tipmsg.r = null;

            var showmsg = function (msg) {
                //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
                alert(msg);
            }

            // select2
            $(".select2_single").select2({
                placeholder: "请选择快递公司",
                allowClear: true
            });

            $(".select2_single2").select2({
                placeholder: "请选择订单状态",
                allowClear: true
            });


            $("#registerForm").Validform({
                tiptype: function (msg) {
                    layer.msg(msg);
                },
                tipSweep: true
            });
        })
    </script>

    <!-- upload_arr -->
    <script src="__STATIC__/js/upload.photos.js"></script>
    <script type="text/javascript" src="__STATIC__/plupload/plupload.full.min.js"></script>
    <!-- Times -->
    <script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
    <!-- validform -->
    <script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
    <script src="__STATIC__/js/layer.js"></script>
    <!-- select -->
    <script src="__STATIC__/js/select/select2.full.min.js"></script>
    <!-- upload -->
    <script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>

    <!-- ueditor -->
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>

    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>

    <!-- upload_arr -->
    <script src="__STATIC__/js/upload.photos.js"></script>
    <script type="text/javascript" src="__STATIC__/plupload/plupload.full.min.js"></script>
    <!-- Times -->
    <script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
    <!-- validform -->
    <script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
    <script src="__STATIC__/js/layer.js"></script>
    <!-- select -->
    <script src="__STATIC__/js/select/select2.full.min.js"></script>
    <!-- upload -->
    <script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>

    <!-- ueditor -->
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>

    <script>
        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        $(".del").live("click", function () {

            $(this).parent().parent(".item").remove();
        })
        // 组图排序 删除图片
        $(".toleft").live("click", function () {
            var item = $(this).parent().parent(".item");
            var item_left = item.prev(".item");
            if ($("#photos_area").children(".item").length >= 2) {
                if (item_left.length == 0) {
                    item.insertAfter($("#photos_area").children(".item:last"));
                } else {
                    item.insertBefore(item_left);
                }
            }

        })

        $(".toright").live("click", function () {
            var item = $(this).parent().parent(".item");
            var item_right = item.next(".item");
            if ($("#photos_area").children(".item").length >= 2) {
                if (item_right.length == 0) {
                    item.insertBefore($("#photos_area").children(".item:first"));
                } else {
                    item.insertAfter(item_right);
                }
            }
        })


        // validform
        $(function () {
            $(".select2_multiple").select2({
                maximumSelectionLength: 0,
                placeholder: "请选择关联栏目",
                allowClear: true
            });
            $.Tipmsg.r = null;

            var showmsg = function (msg) {
                //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
                alert(msg);
            }
            $("#registerForm").Validform({
                tiptype: function (msg) {
                    layer.msg(msg);
                },
                tipSweep: true
            });
            // select2
            $(".select2_single").select2({
                placeholder: "请选择分类",
                allowClear: true
            });

            // upload
            new uploadPreview({UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow"});






            $(":radio").click(function () {

                if (this.checked) {
                    if ($(this).attr("id") == "freight_type_1") {
                        $("#immobilization").show();
                        $("#template").hide();
                    }else{
                        $("#immobilization").hide();
                        $("#template").hide();
                    }
                }
            });
        });

        // 组图上传
        var uploader = new plupload.Uploader({
            runtimes: 'html5,flash,silverlight,html4',
            browse_button: 'logo_upload_btn',
            url: "/index.php/client/shop_goods/uploadarr.html",
            flash_swf_url: '__STATIC__/plupload/Moxie.swf',
            silverlight_xap_url: '__STATIC__/plupload/Moxie.xap',

            filters: {
                max_file_size: '5000kb',
                mime_types: [
                    {title: "files", extensions: "jpg,png,gif,jpeg"}
                ]
            },
            multi_selection: true,
            init: {
                FilesAdded: function (up, files) {
                    $("#btn_submit").attr("disabled", "disabled").addClass("disabled").val("正在上传...");
                    var item = '';
                    plupload.each(files, function (file) { //遍历文件
                        item += "<div class='item' id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></div>";
                    });
//                var item_right = item.next(".item");
////                alert(item_right.length);
//                if(item_right.length >= 2){
//                    alert('最多只能上传2图片');
//                    return false;
//                }
                    $("#photos_area").append(item);
                    uploader.start();
                },
                UploadProgress: function (up, file) { //上传中，显示进度条
                    var percent = file.percent;
                    $("#" + file.id).find('.bar').css({"width": percent + "%"});
                    $("#" + file.id).find(".percent").text(percent + "%");
                },
                FileUploaded: function (up, file, info) {

                    var data = eval("(" + info.response + ")");

                    $("#" + file.id).html("<input type='hidden' name='picArr[]' value='" + data.src + "'><img src='__PUBLIC__/" + data.src + "' alt='" + data.name + "' width='100px' height='100px'><div class='operate'><i class='toleft'>左移</i><i class='toright'>右移</i><i class='del'>删除</i></div>")
                    $("#btn_submit").removeAttr("disabled").removeClass("disabled").val("提 交");
                    if (data.error != 0) {
                        layer.msg(data.error);
                    }
                },
                Error: function (up, err) {
                    layer.msg(err.message);
                    $("#btn_submit").removeAttr("disabled").removeClass("disabled").val("提 交");
                }
            }
        });
        uploader.init();


        function delThisTr(trobj)
        {
            trobj.parent().parent().remove();
        }

        function delThis(trobj,id)
        {
            if(confirm('确认删除？')){
                $.ajax({
                    url : '{:url("shop_assignor_records")}',
                    data:{'id':id},
                    dataType:'json',
                    success:function(data){
                       console.log('d'+data);
//                        data = JSON.parse(data);
                        console.log(data)
                        if(data.code == 200){
                            layer.msg('删除成功');
                            trobj.parent().parent().remove();
                        }else{
                            layer.msg(data.message);
                        }
                    }
                });
            }
        }
        function delThigoods(trobj,id)
        {
            if(confirm('确认删除？')){
                $.ajax({
                    url : '{:url("service_order_goods")}',
                    data:{'id':id},
                    dataType:'html',
                    success:function(data){
                        data = JSON.parse(data);
                        console.log(data)
                        if(data.code == 200){
                            layer.msg('删除成功');
                            trobj.parent().parent().remove();
                        }else{
                            layer.msg(data.message);
                        }
                    }
                });
            }
        }
        var assgioner = {$shop_assignor};
        console.log(assgioner);
        var s = [];
        var ss = [];
        $.each(assgioner, function(k,v){
            ss += '<option value="'+v.id+'">'+v.name+'</option>';
        });

        s = '<tr><td><select name="status" class="form-control" tabindex="-1">' + ss
        s += '</select></td>';
        console.log(s);
        var gift_c;
        $.each({$service_people_price}, function(k,v){ //服务人员提成
            gift_c += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });
        var gift_shop_content;
        $.each({$service_people_price2}, function(k,v){ //服务人员提成
            gift_shop_content += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });
        var gift_shop_content_price; //金额
        $.each({$service_people_price2}, function(k,v){ //服务人员提成
            gift_shop_content_price += '<option value="'+v.id+'-'+v.person_price+'">'+v.person_price+'</option>';
        });

        console.log('1');
        console.log('gf----'+gift_shop_content_price);
        console.log('3');
        //    $(".addNewTr").click(function(){
        //        str = '<tr><td><select name="assignor_id[]" class="form-control" tabindex="-1">' + ss +
        //            '</select></td>' +
        //            '<td><select name="single_id[]" onchange="single2(this.value,this)" class="form-control" tabindex="-1">' + gift_c +
        //            '<td><select name="assignor_content[]" onchange="person_price(this.value,this)" class="form-control" tabindex="-1">' + gift_shop_content +
        //            '<td><input name="assignor_price[]" readonly class="form-control" value="'+{$service_people_price2}[0]['person_price']+'" /></td>'+
        //            '<td><input type="text" value="{:date('Y-m-d H:i:s',time())}" /></td>' +
        //            '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td></tr>';
        //        $("#fieldtr").append(str);
        //    });
        $(".addNewTr").click(function(){
            str = '<tr><td><select name="typea[]" onchange="single_price(this.value,this)" class="form-control select2_single" tabindex="-1"><option value="1">服务提成</option><option value="2">销售提成</option></select></td>' +
                '<td><select name="assignor_id[]" class="form-control" tabindex="-1">' + ss +
                '</select></td>' +
                '<td><select name="single_id[]" onchange="single2(this.value,this)" class="form-control" tabindex="-1">' + gift_c +
                '<td><select name="assignor_content[]" onchange="person_price(this.value,this)" class="form-control" tabindex="-1">' + gift_shop_content +
                '<td><input name="assignor_price[]" readonly class="form-control" value="'+{$service_people_price2}[0]['person_price']+'" /></td>'+
                '<td>未同意</td><td><input type="text" value="{:date('Y-m-d H:i:s',time())}" /></td>' +
            '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td></tr>';
            $("#fieldtr").append(str);
        });

        function single_price(v,t) {
            var shop_id = $("[name='shop_id']").val();
            var single_id = $(t).parent().next().next().next().find('select').val();

            if(v == 1){
                $(t).parent().next().next().next().next().find('input').val({$service_people_price2}[0]['person_price']);
            }else{


                $.ajax({
                    url : '{:url("single/single_ajax")}',
                    data:{'shop_id':shop_id,'single_id':single_id},
                    dataType:'json',
                    success:function(data){
                        var str = [];
                        console.log(data);
                        $(t).parent().next().next().next().next().find('input').val(data);

                    }
                });
            }

        }
        function single2(id,t) { //获得2级类以及价格
            var shop_id = $("[name='shop_id']").val();
            $.ajax({
                url : '{:url("single/ajax2")}',
                data:{'id':id,'shop_id':shop_id},
                dataType:'json',
                success:function(data){
                    var str = [];

                    console.log(data);
                    str = '<select name="assignor_content[]" onchange="person_price(this.value,this)" class="select2_single form-control" tabindex="-1">';
                    $.each(data, function(k,v){
                        str += '<option value="'+v.id+'">'+v.cat_name+'</option>';
                    });
                    str += '</select>';
                    str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
                    str +="<script>\n" +
                        "                                        $(\".select2_single\").select2({\n" +
                        "                                            placeholder: \"请选择分类\",\n" +
                        "                                            allowClear: true\n" +
                        "                                        });\n" +
                        "                                    <\/script>";
                    $(t).parent().next().html(str);
                    var person_price = [];
                    person_price = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data[0]['person_price']+'" /></td>';

                    $(t).parent().next().next().html(person_price);
                    console.log(str);
                }
            });
        }
        function person_price(id,t) { //二级类获得字的价格
            var shop_id = $("[name='shop_id']").val();
            $.ajax({
                url : '{:url("single/ajax4")}',
                data:{'id':id,'shop_id':shop_id},
                dataType:'json',
                success:function(data){
                    console.log(data);
                    var person_price = [];
                    person_price = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
                    $(t).parent().next().html(person_price);
                }
            });
        }
        //分类
        var category = {$category};
        var cat_list = '<option value="0">'+'&nbsp&nbsp'.repeat(1)+'|--全部分类</option>';
        var repeat = '-';
        $.each(category, function(k,v){
            cat_list += '<option value="'+v.id+'">'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.title+'</option>';
        });
        //规格商品 门店或全部
        var spec_attr_list = {$spec_attr_list};
        var spec_list = [];
        console.log(spec_attr_list);
        $.each(spec_attr_list, function(k,v){
            spec_list += '<option value="'+v.id+'">'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.shop_title+'-'+v.title+'-'+v.attribute+'-'+v.inventory+'</option>';
        });
        console.log(spec_list);
        var shop_id = 0;
        {eq name=":session('auding_status')" value="2"}
        var shop_id = $('[name="shop_id"]').val();
        {/eq}

            $(".addNewTrgoods").click(function(){

                var str =
                    '<tr>' +
                    '<td><select name="typea[]" class="form-control select2_single" tabindex="-1"><option value="1">服务提成</option><option value="2">销售提成</option></select></td>' +
                    '<td><select name="cat_id[]" onchange="goods_list(this.value,this,'+shop_id+')" class="select2_single form-control" tabindex="-1">' + cat_list +
                    '</select></td>' +
                    '<td><select name="spec_id[]" id="spec" class="select2_single form-control" tabindex="-1">' + spec_list +
                    '</select></td>' +
                    '<td><input type="text" name="number[]" oninput="inventory(this,this.value)"  /></td>'+
                    '<td><input type="text" value="{:date('Y-m-d H:i:s',time())}" /></td>' +
                '<td><a href="javascript:;" onclick="delThisTrgoods($(this))">删除</a></td>' +
                '</tr>';
                str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
                str +="<script>\n" +
                    "                                        $(\".select2_single\").select2({\n" +
                    "                                            placeholder: \"请选择分类\",\n" +
                    "                                            allowClear: true\n" +
                    "                                        });\n" +
                    "                                    <\/script>";
                $("#fieldtrgoods").append(str);
            });
            function delThisTrgoods(trobj)
            {
                trobj.parent().parent().remove();
            }
            function inventory(t,number) {
                console.log($(this));
                var spec_id = $(t).parent().prev().find('select').val();

                $.ajax({
                    url : '{:url("inventory")}',
                    data:{'number':number,'spec_id':spec_id},
                    dataType:'json',
                    success:function(data){
                        if(data.code != 200){
                            layer.msg(data.message);
                            return false;
                        }
                    }
                });
//        $('name=["spec_id"]').val();
//        if(number > inventory){
//            layer.msg('商品数量大于库存数量');
//        }
            }
            function goods_list(id,t,shop_id){
                $.ajax({
                    url : '{:url("goods_list")}',
                    data:{'cat_id':id,'shop_id':shop_id},
                    dataType:'json',
                    success:function(data){
                        var str = [];
                        console.log(data);
                        str = '<select name="spec_id[]" class="select2_single form-control" tabindex="-1">';
                        $.each(data, function(k,v){
                            str += '<option value="'+v.id+'">'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.shop_title+'-'+v.title+'-'+v.attribute+'-'+v.inventory+'</option>';
                        });
                        str += '</select>';
                        str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
                        str +="<script>\n" +
                            "                                        $(\".select2_single\").select2({\n" +
                            "                                            placeholder: \"请选择分类\",\n" +
                            "                                            allowClear: true\n" +
                            "                                        });\n" +
                            "                                    <\/script>";
                        $(t).parent().next().html(str);
//                console.log(str);
                    }
                });
            }


        //-------------------------------------





    </script>
    <!-- daterangepicker -->
    <script src="__STATIC__/js/datepicker/daterangepicker.js"></script>
    <script type="text/javascript">
        $('#interval_timer').daterangepicker(null,
            function(start, end, label) {
                console.log(start.toISOString(), end.toISOString(), label);
            });
        var str = '<a href="http://www.baidu.com">链接111111111</a> ';
        var reg1 = /href=\"(.+)\"/g;
        var reg2 = /\">(.+)<\/a>/g;
        var retVal1 = reg1.exec(str);
        var retVal2 = reg2.exec(str);
        //alert(retVal1[1]);
        //alert(retVal2[1]);
    </script>
    <script src="__STATIC__/js/sku.js"></script>
</body>

</html>
<!--与代码无关可以删除-->
<script src="/pic/js/jquery.min.js"></script>
<script src="/pic/js/amazeui.js"></script>
<!--<script src="/jquery-1.10.2.js" type="text/JavaScript" language="javascript"></script>-->
<!--<script src="/jquery-ui-1.10.4.custom.js"></script>-->
<script src="/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
<script>
    $('#status_2').click(function () {
        $('.service_people').hide();
    });
    $('#status_1').click(function () {
        $('.service_people').show();
    });
    $("#btnPrint").click(function(){
        $("#printArea").printArea();
    });
    $("#btnPrintFull").click(function(){
        $("body").printArea();
    });

    $('#status_4').click(function () { //是隐藏提成
        $('#service_people').show();
        $('.tc').hide();
    });
    $('#status_3').click(function () {
        $('#service_people').show();
        $('.tc').show();
    });

</script>
